package cn.shop.transcation.order.mapper;

import cn.shop.base.MyPage;
import cn.shop.transcation.order.entity.Order;
import cn.shop.transcation.order.entity.OrderQueryReq;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Map;

/**
 * @author : 李一涵
 * @date : Created in 2021-11-8 14:00
 * @description : mapper
 */
@Mapper
public interface OrderMapper extends BaseMapper<Order> {

	MyPage<Order> pageWithMerchantInfo(@Param("page") MyPage<Order> page, @Param("req") OrderQueryReq req);

	Map<String, Object> statisticsBack(@Param("req") OrderQueryReq req);

	Page<Order> pageWithMerchantInfo(@Param("page") Page<Order> page, @Param(Constants.WRAPPER) LambdaQueryWrapper<Order> wrapper);

	Map<String, Object> statistics(@Param(Constants.WRAPPER) LambdaQueryWrapper<Order> wrapper);

	BigDecimal sumAmount(@Param("pid") long pid, @Param("nickname") String nickname, @Param("account") String account, @Param("uid") long uid);
}
